import asyncio
from edge_tts import Communicate
import os

async def main():
    text = "你好,我是AI助手"
    voice = "zh-CN-XiaoxiaoNeural"  # 女声，可替换为男声如 zh-CN-YunxiNeural

    communicate = Communicate(text=text, voice=voice)
    await communicate.save("/root/autodl-tmp/output.wav")

def run_generate_video():
    # 运行bash命令
    os.system("python /root/Easy-Wav2Lip/inference.py \
    --checkpoint_path /root/autodl-tmp/checkpoints/Wav2Lip_GAN.pth \
    --face /root/autodl-tmp/video_wav_in/liuxing.jpg \
    --audio /root/autodl-tmp/output.wav")


if __name__ == "__main__":
    asyncio.run(main())
    run_generate_video()
